/*varwid.c -- 使用变宽输出字段*/
#include "stdio.h"

int main(void){
    unsigned width,precision;
    int number = 256;
    double weight = 242.5;

    printf("width:\n");
    scanf("%d",&width);
    printf("the number is : %*d:\n",width,number);//*:width;d:number
    printf("Now Enter a width and a precision:\n");
    scanf("%d,%d",&width,&precision);
    printf("Weight = %*.*f\n",width,precision,weight);//*:width;*:precision;d:number
    printf("Done!\n");
    
    return 0;
}